//
//  MineMainViewController.swift
//  ModernFoodWebsite
//
//  Created by apple on 16/5/31.
//  Copyright © 2016年 Lonnie. All rights reserved.
//

import UIKit

class MineMainViewController: BaseTableViewController {
    
   override func viewDidLoad() {
        super.viewDidLoad()
        title = ""
        self.tableView.rowHeight = UITableViewAutomaticDimension
        self.tableView.estimatedRowHeight = 100
        self.tableView.tableFooterView = UIView()
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(named: "icon_setting"), style: .Plain, action: { (item) in
        
        })
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(named: "icon_message"), style: .Plain, action: { (item) in
        
        })
    }
 
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 2
    }
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        if indexPath.row == 0 {
            let cell = tableView.dequeueReusableCellWithIdentifier("top")
            return cell!
        } else {
            let cell = tableView.dequeueReusableCellWithIdentifier("bottom") as! MineMainBottomCell
            cell.collectView.addTapAction({ (tap) in
                
            })
            cell.topicView.addTapAction({ (tap) in
                
            })
            cell.commentView.addTapAction({ (tap) in
                
            })
            cell.publishView.addTapAction({ (tap) in
                
            })
            cell.friendView.addTapAction({ (tap) in
                self.performSegueWithIdentifier("friend", sender: nil)
            })
            return cell
        }
    }
    
    override func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
        return UIView()
    }
}
